﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Basket.aspx.cs" Inherits="MyShop.Basket" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Button ID="ButtonGoBack" runat="server" OnClick="ButtonGoBack_Click" CausesValidation="False" Text="Go Back" Width="171px" />
        </div>
        <fieldset style="width:693px; float:left;margin:20px">
            <legend>Order Form</legend>
            
                <div>
                    <asp:Label ID="Label1" runat="server" AssociatedControlID="FirstName">First name</asp:Label>
                    <asp:TextBox runat="server" ID="FirstName" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="FirstName"
                        CssClass="field-validation-error" ErrorMessage="The first name field is required." />
                </div>
                <div>
                    <asp:Label ID="Label5" runat="server" AssociatedControlID="LastName">Last name</asp:Label>
                    <asp:TextBox runat="server" ID="LastName" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="LastName"
                        CssClass="field-validation-error" ErrorMessage="The Last name field is required." />
                </div>
                <div>
                    <asp:Label ID="Label2" runat="server" AssociatedControlID="Email">Email address</asp:Label>
                    <asp:TextBox runat="server" ID="Email" TextMode="Email" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Email"
                        CssClass="field-validation-error" ErrorMessage="The email address field is required." />
                </div>
                <div>
                    <asp:Label ID="Label3" runat="server" AssociatedControlID="PhoneNumber">Phone number</asp:Label>
                    <asp:TextBox runat="server" ID="PhoneNumber" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="PhoneNumber"
                        CssClass="field-validation-error" ErrorMessage="The Phone Number field is required." />
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                     ControlToValidate="PhoneNumber" ValidationExpression="\d{10}"
                     ErrorMessage="Phone Number is not in a valid format" Display="dynamic">
                    </asp:RegularExpressionValidator>
                </div>
                 <div style="margin-bottom:20px;">
                      <asp:Label ID="Label4" runat="server" >Delivery method</asp:Label>
                   <asp:DropDownList id="DeliveryDropDownList" runat="server" >
                       <asp:ListItem Text="Pickup" value="Pickup" selected="True"></asp:ListItem>
                       <asp:ListItem value="HomeDelivery" Text="Home Delivery"></asp:ListItem>
                   </asp:DropDownList>
                </div>
        <asp:Button ID="OrderButton" runat="server" CommandName="MoveOrder" OnClick="OrderButton_Click" Text="Order" Width="171px"/>
    </fieldset>
    <div style="margin:20px; float:left">
    Product:
        <asp:GridView ID="GridViewProduct" runat="server" AutoGenerateColumns="False" Width="185px" BackColor="White" BorderColor="#DEDFDE" 
            BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="ModelName" HeaderText="Model" DataFormatString="{0:C}"/>
                <asp:BoundField DataField="Description" HeaderText="Description"/>
                <asp:BoundField DataField="Price" HeaderText="Price" DataFormatString="{0:C}"/>
                <asp:TemplateField HeaderText="Count">
                    <ItemTemplate>
                    <asp:TextBox ID="Count_textbox" CommandArgument='<%# Eval("ID") %>' Text='<%# Eval("CountOrdered") %>' runat="server" Width="50px"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="Proof of purchase" ControlStyle-Width="100px">
                    <ItemTemplate>
                    <asp:CheckBox runat="server" CommandName="StatusClick" CommandArgument='<%# Eval("ID") %>' ID="Approval_checkbox" Checked='<%# Bind("Approval") %>'></asp:CheckBox>
                    </ItemTemplate>
                     <ControlStyle Width="100px"></ControlStyle>
                </asp:TemplateField>  
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle BackColor="#F7F7DE" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#FBFBF2" />
            <SortedAscendingHeaderStyle BackColor="#848384" />
            <SortedDescendingCellStyle BackColor="#EAEAD3" />
            <SortedDescendingHeaderStyle BackColor="#575357" />
        </asp:GridView>
        
        <div style="margin: 20px">
            <asp:TextBox runat="server" ID="TotalAmount" ></asp:TextBox>
            <asp:Button runat="server" Text="Refresh Amount" ID="AmounButton" OnClick="AmounButton_OnClick" CausesValidation="False"/>
        </div>
    </div>
    </form>
</body>
</html>
